#include <iostream>
#include <algorithm>

using namespace std;

long long sumOfMaxMod(long long n, int k)
{
    long long result = 0;
    for (long long remainder = 1; k > 0; ++remainder)
    {
        // Calculate the number of divisors that give this remainder
        long long startDivisor = (n - remainder + 1) / (remainder + 1) + 1;
        long long endDivisor = n / remainder;

        if (startDivisor > endDivisor)
            break; // No more valid divisors

        long long actualCount = min(k, (int)(endDivisor - startDivisor + 1));
        result += actualCount * remainder;
        k -= actualCount;
    }

    return result;
}

int main()
{
    long long n;
    int k;
    cin >> n >> k;

    cout << sumOfMaxMod(n, k) << endl;

    return 0;
}